package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.TaskPanel;
import com.sc.nft.mapper.TaskPanelMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 任务模板表(sc_task_panel)数据DAO
 *
 * @author 张翔宇
 * @since 2023-03-29 11:14:52
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class TaskPanelDao extends ServiceImpl<TaskPanelMapper, TaskPanel> {


    /**
     * 获取上架任务模板
     */
    public List<TaskPanel> taskPanelList() {
        LambdaQueryWrapper<TaskPanel> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TaskPanel::getStatus, true);
        return list(wrapper);
    }

    public List<TaskPanel> taskPanelMerchantList() {
        LambdaQueryWrapper<TaskPanel> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(TaskPanel::getStatus, true);
        wrapper.eq(TaskPanel::getBusinessUseStatus, true);
        return list(wrapper);
    }

}